package org.jtb.quickr;

import java.net.MalformedURLException;
import java.net.URL;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import org.apache.log4j.Logger;

class PostUrl extends SignedUrl {    
    private static Logger logger = Logger.getLogger(PostUrl.class.getName());  
    
    
    public PostUrl(String baseUrl, Map<String,String> args, String apiKey, String secret) throws QuickrException {
        this(baseUrl, args, apiKey, secret, null);
    }

    public PostUrl(String baseUrl, Map<String,String> args, String apiKey, String secret, AuthResponse.Token authToken) throws QuickrException {
        super(baseUrl, args, apiKey, secret, authToken);
    }
    
    protected URL buildUrl() throws QuickrException {
        try {
            URL url = new URL(getBaseUrl());
            if (logger.isDebugEnabled()) {
                logger.debug("url: " + url);
            }
            return url;
        } catch (MalformedURLException mfue) {
            throw new QuickrException("could not create URL", mfue);
        }                
    }
}
